/*
 * LppgmProtocol.h
 *
 * Created: 10/11/2012 08:56:14
 *  Author: Administrator
 */ 


#ifndef LPPGMPROTOCOL_H_
#define LPPGMPROTOCOL_H_
#include <Arduino.h>

#define STX 0x3A
#define EOT 0x24
#define ACK 0x06
#define NAK 0x15
#define MASTER 0x00
#define FUNC_READ 0x00
#define FUNC_WRITE 0x01
#define FUNC_BARCODE 0x01
#define FUNC_SEND_DEFECT 0x02
#define FUNC_REQ_QC 0x03
#define FUNC_KEEP_ALIVE 0x07

#define HE_A 0x01
#define HE_B 0x02

void SendACK(int dest,int src);
void SendNAK(int dest,int src);
void SendBarcode(int dest, int src,uint16_t qc_id, uint32_t barcode,uint8_t he_type, uint16_t label_no, uint8_t order_type);


void PrintHex8(uint8_t *data, uint8_t length);
void PrintHex16(uint16_t *data, uint8_t length);
#endif /* LPPGMPROTOCOL_H_ */